package com.inspur.edp.ai.flow.node;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.inspur.edp.ai.flow.metadata.AbsNode;
import com.inspur.edp.common.expr.ExprJsonDeserializer;
import com.inspur.edp.common.expr.Express;
import com.inspur.edp.common.expr.evaluator.ExpressEvaluator;
import lombok.Data;

import java.util.List;

/**
 * @author lizhaorui
 * @date 2025/8/15
 * @description
 */

@Data
public class SelectorNode extends AbsNode {

    public static final String KIND = "selector";

    public SelectorNode() {
        this.setKind(KIND);
    }

    private List<SelectorBranch> branches;

    @Data
    public static class SelectorBranch {

        @JsonIgnore
        private ExpressEvaluator conditionEvaluator;

        private String condition;

        @JsonDeserialize(using = ExprJsonDeserializer.class)
        private Express conditionExpr;

        private String port;
    }

}